<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript">
        function method01(){
            //获取按钮标签
            var buttonElement=document.getElementById('id01');
            //获取按钮标签的内容
            var content=buttonElement.value;
            //把获取到的内容输出
            alert('按钮上显示的内容为：'+content+'。')
        }
    </script>
</head>
<body>
<form name="form01">
    <input id="id01" type="button" value="按钮" name="name01"/><br>
</form>
<a href="#" onclick="method01()">测试</a>
</body>
</html>